On-Demand Instances
💡 Definition
On-Demand Instances are an EC2 pricing option that lets you pay for compute capacity by the hour or second with no long-term commitments. You have full control over the instance's lifecycle—you decide when to launch, stop, hibernate, or terminate it.
🔑 Key Concepts
- No Commitment: You pay only for the time the instances are running.
- Flexibility: Ideal for applications with short-term, spiky, or unpredictable workloads that cannot be interrupted.
- Highest Cost (per hour): Has the highest per-hour cost compared to Reserved Instances and Spot Instances, but you pay for nothing when it's off.
⚙️ How it Works
When you launch an EC2 instance without specifying a different pricing model, it launches as an On-Demand instance. Billing begins when the instance starts and ends when it is terminated or stopped.
🎯 Use Cases
- Development and Testing: For applications being developed or tested on EC2 for the first time.
- Unpredictable Workloads: Applications with usage that spikes unpredictably.
- Short-Term Projects: For workloads that are not expected to run for a long duration (less than a year).
💰 Pricing Model
- Pay-as-you-go: Charged per second (for Linux) or per hour (for Windows) that the instance is in a
runningstate. No upfront payment is required.
📝 Exam Tips (CLF-C02)
- Keywords: "No long-term commitment", "Pay by the hour/second", "Unpredictable workloads".
- Offers the most flexibility but at the highest hourly price.
- Good for applications that need to run without interruption but don't run consistently enough to justify a Reserved Instance or Savings Plan.
See Also: * EC2 * Reserved Instances * Spot Instances * Savings Plans